home *** CD-ROM | disk | FTP | other *** search
/ PC Professionell 2006 May / PCpro_2006_05.ISO / files / mobile / fma-2.0-stable-setup.exe / {app} / sframework / plugins / PluginInfo.vbs < prev    next >
Encoding:
Text File  |  2004-09-09  |  2.6 KB  |  95 lines

  1. 'FMA Script Framework Core Plugin
  2. 'PluginInfo
  3. 'Offers some information of the available plugins
  4.  
  5. 'TODO:
  6. '-nothing atm
  7.  
  8. Class PluginInfo
  9.     
  10.     Private m_Self
  11.     Private mainMenu
  12.     Private pluginMenu
  13.     
  14.     'Some info about the plugin
  15.     Public Property Get SHOWABLE 'Do I have a menu?
  16.         SHOWABLE    = True
  17.     End Property
  18.     Public Property Get TITLE 'What's my name?
  19.         TITLE       = "Plugin Info"
  20.     End Property
  21.     Public Property Get DESCRIPTION 'What's my purpose?
  22.         DESCRIPTION = "Offers some information about the loaded plugins"
  23.     End Property
  24.     Public Property Get AUTHOR 'Who created me?
  25.         AUTHOR      = "streawkceur"
  26.     End Property
  27.     Public Property Get URL 'Were can I be found? Where can you get more information?
  28.         URL = "http://fma.xinium.com/"
  29.     End Property
  30.     
  31.     'Who am I?
  32.     Public Property Let Self (s)
  33.         m_Self = s
  34.         Set mainMenu   = New ManagedMenu
  35.         Set pluginMenu = New ManagedMenu
  36.     End Property
  37.     Public Property Get Self
  38.         Self = m_Self
  39.     End Property
  40.     
  41.     Sub Show()
  42.         Dim pluginList, menuList, bi, it, comp
  43.         Set comp = New PluginTitleComparator
  44.         Set pluginList = PluginManager.GetLoadedPluginsLinkedList
  45.         QuickSorter.ComparatorSortLL pluginList, comp
  46.         Set menuList = New LinkedList
  47.         
  48.         bi = menuList.BackInserter
  49.         it = pluginList.Begin
  50.         'Add all plugins
  51.         Do Until it.Object Is pluginList.Last.Object
  52.             bi.Item = Array(it.Item, Self & ".InfoMenu"""& it.Item & """")
  53.             it.iterate()
  54.         Loop
  55.         mainMenu.SetList menuList
  56.         mainMenu.Title = TITLE
  57.         mainMenu.ShowMenu
  58.     End Sub
  59.     
  60.     ' Shows a menu with plugin information
  61.     Sub InfoMenu( plugin )
  62.         Dim menuList, bi
  63.         Set menuList = New LinkedList
  64.         
  65.         bi = menuList.BackInserter
  66.         bi.Item = Array("Title",       Self & ".InfoTitle"""  & plugin & """")
  67.         bi.Item = Array("Description", Self & ".InfoDescr"""  & plugin & """")
  68.         bi.Item = Array("Author",      Self & ".InfoAuthor""" & plugin & """")
  69.         bi.Item = Array("URL",         Self & ".InfoURL"""    & plugin & """")
  70.         pluginMenu.Title = plugin
  71.         pluginMenu.SetList menuList
  72.         pluginMenu.ShowMenu
  73.     End Sub
  74.     
  75.     Sub InfoTitle( plugin )
  76.         EmptyMenu.ShowMenu
  77.         am.DlgInformation "Title", PluginManager(plugin).TITLE
  78.     End Sub
  79.     
  80.     Sub InfoDescr( plugin )
  81.         EmptyMenu.ShowMenu
  82.         am.DlgInformation "Description", PluginManager(plugin).DESCRIPTIOn
  83.     End Sub
  84.     
  85.     Sub InfoAuthor( plugin )
  86.         EmptyMenu.ShowMenu
  87.         am.DlgInformation "Author", PluginManager(plugin).AUTHOR
  88.     End Sub
  89.     
  90.     Sub InfoURL( plugin )
  91.         If PluginManager(plugin).URL <> "" Then Shell.Run "RunDLL32.EXE shell32.dll,ShellExec_RunDLL """ & PluginManager(plugin).URL & """"
  92.         am.Update
  93.     End Sub
  94.  
  95. End Class